#pragma once
#include "afxwin.h"
#include "ACEdit.h"
#include "explorer_window.h"


// CDlgSendRequest dialog

class CDlgSendRequest : public CDialog
{
	DECLARE_DYNAMIC(CDlgSendRequest)

public:
	CDlgSendRequest(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgSendRequest();

	virtual BOOL OnInitDialog();
	virtual void OnOK();
	afx_msg void OnBnClickedCancel();

	afx_msg void OnBnClickedButtonBrowseFile();
	afx_msg void OnBnClickedButtonThumbnail();
	afx_msg void OnCbnSelchangeComboCollection();
	afx_msg void OnBnClickedButtonOpen();
	afx_msg void OnBnClickedButtonDelete();

// Dialog Data
	enum { IDD = IDD_DIALOG_SEND_REQUEST };
	enum { DELETE_NO, DELETE_AND_CLOSE, DELETE_STAY_OPEN };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

private:
	REQUEST_SET m_Request;
	USER_SET m_User;

	LONG m_nWindowWidthShow;
	LONG m_nWindowWidthNoShow;

public:
	void SetPageCount(UINT nCurrent, UINT nTotal);
	BOOL GetFiles();
	void CorrectFilename(CString* pszFileName);	
	BOOL CopyFileToServer(CFilePair* pFiles);
	BOOL SendFileToServer();
	LRESULT FTPWithStatus(CString szServer, CString szFolder, CString szUID, CString szPWD, CFilePair* pFiles);
	LRESULT FTPFileToServer(CString szServer, CString szFolder, CString szUID, CString szPWD, CFilePair* pFiles);
	BOOL FormatMacros(CString* pszString);

private:
	void DoEvents( HWND hWnd_i );

public:
	CComboBox m_ctrlFiles;
	CString m_szDescription;
	CString m_szInformation;
	CString m_szTo;
	BOOL m_bDeferEmail;
	BOOL m_bOverrideEmailCheck;
	BOOL m_bDeleteFile;
	CString m_szStatus;
	INT m_nSendType;
	INT m_nMaterial;

	LONG m_nItemID;
	LONG m_nUserID;
	LONG m_nUserCode;
	LONG m_nStaffID;
	LONG m_nLibraryID;
	LONG m_nCollectionID;
	LONG m_nCopyright;

	INT m_nStatus;
	CString m_szRequest;
	CString m_szDateIn;

	// this is not fully implemented
	BOOL m_bSendMultiple;

	BOOL m_bShowThumbnail;
	BOOL m_bEnableThumbnail;
	BOOL m_bManual;
	INT m_nFileIndex;
	CFilePair m_aFiles;

	CStringArray m_csaDescriptions;
	BOOL m_bPreviewEmail;

	CString m_szMessage;
	CString m_szFrom;
	CString m_szName;
	CString m_szSubject;
	CString m_szAttach;
	double m_dServiceFee;
	double m_dCopyrightFee;
	double m_dMiscFee;

	double m_dUserFeeMax;

	CACEdit m_ctrlEmail;
	CACEdit m_ctrlCollection;

	CStringArray *m_pszaStatus;
	CStringArray *m_pszaPriority;
	CStringArray *m_pszaMethod;
	CStringArray *m_pszaLibrary;
	CStringArray *m_pszaCollection;
	CStringArray *m_pszaReferrals;
	CStringArray *m_pszaCopyright;
	CStringArray *m_pszaILL;

	CStringArray m_szaDescription;
	CACEdit m_ctrlDescription;
	CStringArray m_szaInformation;
	CACEdit m_ctrlInformation;

	CExplorer_window m_wbRequester;	
	CExplorer_window m_wbPreview;
};
